<?
/**
* Copyright (c) 2002-2007 BioWare Corp.
* http://www.bigdaddymonitor.org
*
* This file is part of the BigDaddy Monitoring
* program. It is free software distributed under
* the terms of the BSD License. It is ditributed
* in the hopes that it will be useful, but
* WITHOUT ANY WARRANTY; without event the implied
* warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE.
*
* The BSD License is available from:
* http://www.opensource.org/licenses/bsd-license.php
**/

if (is_array($displayParams["aLinksFrom"]))
{
    ?>
    <div class="wiki_shadow" style="margin-top: 15px;">
        <div class="wiki_white" align="left">
            <div class="wiki_links">
                <div class="smallfont" style="margin-bottom: 8px;">
                    This page is linked from these pages...
                </div>
                <?
                // Again...have to use a table due to IE *TERRIBLE* CSS implementation
                ?>
                <table border="0" width="100%" cellpadding="0" cellspacing="0">
                <?
                
                foreach ($displayParams["aLinksFrom"] as $key => $value)
                {
                    if ($key!="special_wikifulltitle")
                    {
                        ?>
                        <tr>
                        <td width="2%" align="left" valign="top">
                            <div>
                                <b><a href="<?=$_SERVER["PHP_SELF"]."?action=view&wiki=".$key;?>"><?=$displayParams["aLinksFrom"]["special_wikifulltitle"][$key];?></a>:</b>&nbsp;
                            </div>
                        </td>
                        <?
                    }

                    $sLink="";
                    
                    if ($key!="special_wikifulltitle")
                    {
                        foreach ($displayParams["aLinksFrom"][$key] as $sWiki => $sPage)
                        {
                            $sLink.="<a href=\"".$_SERVER["PHP_SELF"]."?action=view&wiki=".$key."&page=".$sPage."\">".$sPage."</a>, ";
                        }
                    }


                $sLink=substr($sLink, 0, strlen($sLink)-2);
                ?>

                <td style="padding-left: 5px;" width="*" align="left"><?=$sLink;?></td>
                </tr>
                
                <?
                }
            
                ?>
            
                    <?
                    if ($displayParams["bShowAllLinksToggle"])
                    {
                        ?>
                        <tr>
                            <td colspan="2">
                                <div style="margin-top: 10px;">
                                    <a href="<?=$_SERVER["PHP_SELF"]."?".$_SERVER["QUERY_STRING"]."&showalllinks=1";?>"><i>There were more links found than are displayed, click here to see all links...</i></a>
                                </div>
                            </td>
                        </tr>
                        <?
                    }
                    ?>
            
            
            </table>
            </div>
        </div>
    </div>
    <?
}
?>
